﻿using System;
using System.IO;
using DDDNorthWind.AC.ImportProducts.Domain.Entities;
using DDDNorthWind.AC.ImportProducts.Domain.ValueObjects;

namespace DDDNorthWind.AC.ImportProducts.Domain.Services
{
    public class ImportService : IImportService
    {

        
        public void Import(StreamReader reader, Guid id)
        {
            string line = reader.ReadLine();
            var supplierId = new ImportSupplierId(id);
            var aggregate = new ImportSupplier(supplierId);

            

            while (line != null)
            {
                var product = CreateProduct(line);

                aggregate.AddProduct(product);

                line = reader.ReadLine();
            }
        }

        private ImportProduct CreateProduct(string line)
        {
            return new ImportProduct();
        }
    }
}